<!DOCTYPE html>
<html lang="zh">

<head>

	<meta charset="utf-8" />
	<meta content="IE=edge" http-equiv="X-UA-Compatible" />
	<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport" />
	<title>逆轉計算</title>
	<link href="https://cdn.staticfile.org/twitter-bootstrap/4.6.1/css/bootstrap.min.css" rel="stylesheet" />
	<link href="https://cdn.staticfile.org/bootswatch/4.6.1/darkly/bootstrap.min.css"
		media="(prefers-color-scheme: dark)" rel="stylesheet" />
	<link href="css/main.css" rel="stylesheet" />
	<style>
		.table-sm td,
		.table-sm th {
			padding: 2px;
		}
	</style>
</head>

<body class="bg-secondary mb-5">
	<!--content-->
	<div class="container mt-3" id="content_div">
		<div class="card shadow">
			<div class="card-header">
				分數類似25000。
				本場和供託不填=0。
				南西北家順序顛倒沒問題
			</div>
			<div class="card-body">
				<div class="input-group">
					<input type="number" id="east" aria-label="ben3chang3" class="form-control" placeholder="東家分數"
						onchange="run()">
					<input type="number" id="south" aria-label="gong4tuo1" class="form-control" placeholder="南家分數"
						onchange="run()">
					<input type="number" id="west" aria-label="ben3chang3" class="form-control" placeholder="西家分數"
						onchange="run()">
					<input type="number" id="north" aria-label="gong4tuo1" class="form-control" placeholder="北家分數"
						onchange="run()">
				</div>
				<div class="input-group mt-3">
					<select id="qieshang" class="form-control" onchange="run()">
						<option value="1" selected>無切上滿貫</option>
						<option value="2">有切上滿貫</option>
					</select>
					<input type="number" aria-label="ben3chang3" class="form-control" placeholder="本場(連莊)"
						onchange="run()">
					<input type="number" aria-label="gong4tuo1" class="form-control" placeholder="供託(立直棒)"
						onchange="run()">
				</div>
			</div>

		</div>
	</div>
	<div class="container mt-3">
		<div class="card shadow">
			<table class="table table-sm table-bordered text-center mb-0">
				<thead>
					<tr>
						<th scope="col" colspan="2" id="qieshang_text">
							無切上滿貫
						</th>
						<th scope="col">東#1<br />250</th>
						<th scope="col">南#2<br />250</th>
						<th scope="col">西#3<br />250</th>
						<th scope="col">北#4<br />250</th>
					</tr>
				</thead>
				<tbody>
					<tr class="table-success">
						<th scope="row" class="table-success" rowspan="6">爭<br />第<br />一</th>
						<th scope="row">20符自摸</th>
						<td><span id="td111">1翻</span></td>
						<td><span id="td112">1翻</span></td>
						<td><span id="td113">1翻</span></td>
						<td><span id="td114">1翻</span></td>
					</tr>
					<tr class="table-success">
						<th scope="row">30符自摸</th>
						<td><span id="td121">1翻</span></td>
						<td><span id="td122">1翻</span></td>
						<td><span id="td123">1翻</span></td>
						<td><span id="td124">1翻</span></td>
					</tr>
					<tr class="table-success">
						<th scope="row">30符榮和</th>
						<td><span id="td131">1翻</span></td>
						<td><span id="td132">1翻</span></td>
						<td><span id="td133">1翻</span></td>
						<td><span id="td134">1翻</span></td>
					</tr>
					<tr class="table-success">
						<th scope="row">40符榮和</th>
						<td><span id="td141">1翻</span></td>
						<td><span id="td142">1翻</span></td>
						<td><span id="td143">1翻</span></td>
						<td><span id="td144">1翻</span></td>
					</tr>
					<tr class="table-success">
						<th scope="row">30符直擊1位</th>
						<td><span id="td151">1翻</span></td>
						<td><span id="td152">1翻</span></td>
						<td><span id="td153">1翻</span></td>
						<td><span id="td154">1翻</span></td>
					</tr>
					<tr class="table-success">
						<th scope="row">40符直擊1位</th>
						<td><span id="td161">1翻</span></td>
						<td><span id="td162">1翻</span></td>
						<td><span id="td163">1翻</span></td>
						<td><span id="td164">1翻</span></td>
					</tr>
					<tr class="table-info">
						<th scope="row" rowspan="6">爭<br />第<br />二</th>
						<th scope="row">20符自摸</th>
						<td><span id="td211">1翻</span></td>
						<td><span id="td212">1翻</span></td>
						<td><span id="td213">1翻</span></td>
						<td><span id="td214">1翻</span></td>
					</tr>
					<tr class="table-info">
						<th scope="row">30符自摸</th>
						<td><span id="td221">1翻</span></td>
						<td><span id="td222">1翻</span></td>
						<td><span id="td223">1翻</span></td>
						<td><span id="td224">1翻</span></td>
					</tr>
					<tr class="table-info">
						<th scope="row">30符榮和</th>
						<td><span id="td231">1翻</span></td>
						<td><span id="td232">1翻</span></td>
						<td><span id="td233">1翻</span></td>
						<td><span id="td234">1翻</span></td>
					</tr>
					<tr class="table-info">
						<th scope="row">40符榮和</th>
						<td><span id="td241">1翻</span></td>
						<td><span id="td242">1翻</span></td>
						<td><span id="td243">1翻</span></td>
						<td><span id="td244">1翻</span></td>
					</tr>
					<tr class="table-info">
						<th scope="row">30符直擊2位</th>
						<td><span id="td251">1翻</span></td>
						<td><span id="td252">1翻</span></td>
						<td><span id="td253">1翻</span></td>
						<td><span id="td254">1翻</span></td>
					</tr>
					<tr class="table-info">
						<th scope="row">40符直擊2位</th>
						<td><span id="td261">1翻</span></td>
						<td><span id="td262">1翻</span></td>
						<td><span id="td263">1翻</span></td>
						<td><span id="td264">1翻</span></td>
					</tr>
					<tr class="table-secondary">
						<th scope="row" rowspan="6">爭<br />第<br />三</th>
						<th scope="row">20符自摸</th>
						<td><span id="td311">1翻</span></td>
						<td><span id="td312">1翻</span></td>
						<td><span id="td313">1翻</span></td>
						<td><span id="td314">1翻</span></td>
					</tr>
					<tr class="table-secondary">
						<th scope="row">30符自摸</th>
						<td><span id="td321">1翻</span></td>
						<td><span id="td322">1翻</span></td>
						<td><span id="td323">1翻</span></td>
						<td><span id="td324">1翻</span></td>
					</tr>
					<tr class="table-secondary">
						<th scope="row">30符榮和</th>
						<td><span id="td331">1翻</span></td>
						<td><span id="td332">1翻</span></td>
						<td><span id="td333">1翻</span></td>
						<td><span id="td334">1翻</span></td>
					</tr>
					<tr class="table-secondary">
						<th scope="row">40符榮和</th>
						<td><span id="td341">1翻</span></td>
						<td><span id="td342">1翻</span></td>
						<td><span id="td343">1翻</span></td>
						<td><span id="td344">1翻</span></td>
					</tr>
					<tr class="table-secondary">
						<th scope="row">30符直擊3位</th>
						<td><span id="td351">1翻</span></td>
						<td><span id="td352">1翻</span></td>
						<td><span id="td353">1翻</span></td>
						<td><span id="td354">1翻</span></td>
					</tr>
					<tr class="table-secondary">
						<th scope="row">40符直擊3位</th>
						<td><span id="td361">1翻</span></td>
						<td><span id="td362">1翻</span></td>
						<td><span id="td363">1翻</span></td>
						<td><span id="td364">1翻</span></td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
	<script>

		function run() {

			var fan5 =//5翻以上
				[8000, 12000, 12000, 16000, 16000, 16000, 24000, 24000, 32000];

			var f30 = [300, 500, 1000, 2000, 3900, 7700];
			var f40 = [400, 700, 1300, 2600, 5200, 8000];
			var q30 = [1500, 2900, 5800, 11600];
			var q40 = [2000, 3900, 7700, 12000];
			var east = document.getElementById("east").value;
			var south = document.getElementById("south").value;
			var west = document.getElementById("west").value;
			var north = document.getElementById("north").value;
			if (east == '' || isNaN(east)
				|| south == '' || isNaN(south)
				|| west == '' || isNaN(west)
				|| north == '' || isNaN(north)
			) { return }
			var qieshang = document.getElementById("qieshang").value;
			var qieshang_text = document.getElementById("qieshang_text")
			if (qieshang === "1") {
				f30[5] = 8000;
				q30[3] = 12000;
				qieshang_text.innerText = "無切上滿貫";
			} else {
				f30[5] = 7700;
				q30[3] = 11600;
				qieshang_text.innerText = "有切上滿貫";
			}
			console.log(1);
		}
	</script>
</body>

</html>